home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / OpenDoc 1.2b2c1 / OpenDoc / Interfaces / CPlusPlus / Link.xh < prev    next >
Encoding:
Text File  |  1997-02-13  |  3.3 KB  |  167 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Link.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: 2.18
  7.  *     SOM Emitter emitxh.dll: 2.33
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Classes defined in this interface
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODLink_xh
  18. #define SOM_ODLink_xh
  19.  
  20. class ODLink;
  21.  
  22. #define ODLink_MajorVersion 1
  23. #define ODLink_MinorVersion 0
  24.  
  25. /* C++ SOM defs */
  26. #include <somcls.xh>
  27. #include <somcm.xh>
  28.  
  29. /* C++ parent defs */
  30. #ifndef SOM_ODBaseLink_xh
  31. #include <LinkB.xh>
  32. #endif
  33.  
  34. #ifndef ODLink_API
  35. #define ODLink_API
  36. /*
  37.  * -- The Class API
  38.  */
  39.  
  40. /*
  41.  * Start of user-defined types:
  42.  */
  43. class SOMClass;
  44. class SOMObject;
  45. class ODFrame;
  46. class ODFacet;
  47. class ODObject;
  48. class ODExtension;
  49. class ODRefCntObject;
  50. class ODPersistentObject;
  51. class ODStorageUnit;
  52. class ODBaseLink;
  53. class ODLinkSource;
  54. class ODPart;
  55. class ODDraft;
  56. class ODLink;
  57.  
  58. /*
  59.  * End of user-defined types.
  60.  */
  61.  
  62. #ifdef OLDIBMSOMAPISUPPORT
  63. #define ODLinkCClassData ODLinkClassData
  64. #define ODLinkNewClass(major,minor) somNewVersionedClassReference(ODLink,major,minor)
  65. #endif
  66.  
  67. /* define xxxMetaClass macro to facilitate (cls ## MetaClass) */
  68. #define ODLinkMetaClass SOMClass
  69.  
  70. #if PRAGMA_ALIGN_SUPPORTED
  71. #  pragma options align=power
  72. #endif
  73.  
  74. /* The API to the ODLink class object, and the methods it introduces. */
  75. SOMEXTERN struct ODLinkClassDataStructure {
  76. #ifdef OLDIBMSOMAPISUPPORT
  77.     SOMClass            *classObject;    /* always zero, use somNewClassReference instead */
  78. #else
  79.     long zero;
  80. #endif
  81.     somStaticClassInfo *sci;
  82.     somDToken        instanceDataToken;
  83.     long reserved [3];
  84.     somMToken reserved1;
  85.     somMToken reserved2;
  86.     somMToken reserved3;
  87.     somMToken reserved4;
  88.     somMToken reserved5;
  89.     somMToken reserved6;
  90.     somMToken reserved7;
  91.     somMToken reserved8;
  92.     somMToken reserved9;
  93.     somMToken reserved10;
  94. } SOMDLINK ODLinkClassData;
  95.  
  96. #if PRAGMA_ALIGN_SUPPORTED
  97. #  pragma options align=reset
  98. #endif
  99.  
  100. #if !defined(ODLink_Class_Source) && !defined(SOM_Module_link_Source)
  101. #if PRAGMA_IMPORT_SUPPORTED
  102. #pragma import list ODLinkClassData
  103. #endif
  104. #endif
  105.  
  106.  
  107. /*
  108.  * -- Typedefs and inline method declarations for left path inherited methods
  109.  * -- are omitted because this compilation had -museinheritedmethods in effect
  110.  */
  111.  
  112.  
  113. /*
  114.  * -- Typedefs for ODLink Method Procedures
  115.  */
  116. SOMEXTERN {
  117. }
  118.  
  119. #endif /* ODLink_API */
  120.  
  121.  
  122. /*
  123.  * -- This emitter treats Method Tokens as Thunks by default.
  124.  * -- Use the sc modifier "nothunks" to change this default
  125.  */
  126. #undef somresolve_
  127. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  128.  
  129. /*
  130.  * -- The C++ Wrapper Class for ODLink
  131.  */
  132. class ODLink : public ODBaseLink
  133. {
  134. public:
  135.  
  136. // ODLink::new registers use of the class object, and then uses somNew
  137. // to allocate memory and load the object method table pointer. 
  138. void *operator new(size_t size)
  139. {
  140.     SOM_IgnoreWarning(size);
  141.     // Allocate memory using the default allocator for ODLink, and
  142.     // clear mem & set method table pointer, call basic initialization
  143. #ifdef SOMCHKNULL
  144.     void * __somResult = (void *)
  145.       somNewObject(ODLink);
  146.     SOMCHKNULL(__somResult);
  147.     return __somResult;
  148. #else
  149.     return (void*) somNewObject(ODLink);
  150. #endif
  151. }
  152.  
  153. // ODLink::delete uses the default deallocator for the object's class.
  154. void operator delete(void * obj)
  155. {
  156.     if (obj) {
  157.         SOM_Resolve(obj,SOMObject,somFree)
  158.            ( (SOMObject*) obj );
  159.     }
  160. }
  161.  
  162. };   /* ODLink */
  163.  
  164.  
  165.  
  166. #endif       /* SOM_ODLink_xh */
  167.